package com.linkoog.devtools.code_generator.wizard.generate.database.table.model.datasource;

import com.linkoog.devtools.code_generator.database.domain.ConnectionInfo;
import com.linkoog.devtools.code_generator.database.dao.DatabaseDao;
import com.linkoog.devtools.code_generator.database.dao.DatabaseDaoFactory;
import org.jetbrains.annotations.NotNull;

public class ConnectionInfoItem {

    private final ConnectionInfo connectionInfo;

    private String currentDatabase;
    private String currentSchema;

    private Boolean hasConnection;
    private DatabaseDao databaseDao;


    public ConnectionInfoItem(@NotNull ConnectionInfo connectionInfo){
        this.connectionInfo = connectionInfo;
        this.databaseDao = DatabaseDaoFactory.create(connectionInfo);
    }

    public ConnectionInfo getConnectionInfo() {
        return connectionInfo;
    }

    public Boolean isHasConnection() {
        return hasConnection;
    }

    public void setHasConnection(Boolean hasConnection) {
        this.hasConnection = hasConnection;
    }

    public DatabaseDao getDatabaseDao() {
        return databaseDao;
    }

    public String getCurrentDatabase() {
        return currentDatabase;
    }

    public void setCurrentDatabase(String currentDatabase) {
        this.currentDatabase = currentDatabase;
    }

    public String getCurrentSchema() {
        return currentSchema;
    }

    public void setCurrentSchema(String currentSchema) {
        this.currentSchema = currentSchema;
    }
}
